/*
 * Copyright (c) Zhongkehonglue Technologies Co., Ltd. 2025. All rights reserved.
 * Description: DMC callback module.
 * Author: wangchunyang
 * Create: 2025-05-23
 */

#ifndef DMC_CALLBACK_H
#define DMC_CALLBACK_H

#include <mutex>
#include "dmcApiTypes.h"

namespace DlnaDmc {

class DmcCallback {
public:
    ~DmcCallback() = default;
    DmcCallback(const DmcCallback&) = delete;
    DmcCallback(DmcCallback&&) = delete;
    DmcCallback& operator=(const DmcCallback&) = delete;
    DmcCallback& operator=(DmcCallback&&) = delete;
    dmc_int32 SetCb(const DmcCbType &cb);
    dmc_int32 ReSetCb();
    dmc_int32 ExecDeviceUpCb(UploadDeviceInfo &deviceInfo);
    dmc_int32 ExecDeviceDownCb(dmc_uint32 deviceId);

    static DmcCallback& GetInstance() {
        return instance;
    }

private:
    static DmcCallback instance;
    DmcCallback() {};

    DmcCbType cb;
    std::mutex mtx;
};
}
#endif /* DMC_CALLBACK_H */

